package org.starti.metadata;

import java.io.Serializable;
import java.lang.reflect.Method;

/**
 * Provides a base interface for all metadata returned by MetadataManager.
 *
 * @author <a href="mailto:claudiu.dumitrescu@gmail.com">Claudiu Dumitrescu</a>
 */
public interface Metadata extends Serializable {

    /**
     * TODO : deprecate this and add an utility method in MetadataAcessor if necessary.
     * Utility function to provide a Iterable of all the methods that this Metadata provides.
     *
     * @return Iterable object, an iterator factory for the underlying collection semantics we have.
     */
    Iterable<? extends Method> getMethods();

    /**
     * TODO : deprecate this and add an utility method in MetadataAcessor if necessary.
     * Utility function to provide a Iterable of all the properties that this Metadata provides.  This is similar to the
     * getMethods() method in this class, but does so for properties of the object we are describing.  This returns a
     * list of Method objects because we are using JavaBean semantics, which means our Fields are represented by getX()
     * and setX() methods for an object field named X.
     *
     * @return Iterable object, an iterator factory for the underlying collection semantics we have.
     */
    Iterable<? extends Method> getProperties();
}
